home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 9736 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  983 b 

  1. Path: lantana.singnet.com.sg!usenet
  2. From: kim hai <Kim_Hai.Ng@msmail.st.stems.com>
  3. Newsgroups: comp.lang.c
  4. Subject: Help !!!!! on 'strstr"
  5. Date: Wed, 13 Mar 1996 09:21:03 -0800
  6. Organization: stems
  7. Message-ID: <314703FF.4045@msmail.st.stems.com>
  8. NNTP-Posting-Host: ts900-3207.singnet.com.sg
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 2.0 (Win16; I)
  13.  
  14. Help !!!!!
  15.  
  16. Problem :
  17.     I need to locate a string within another string, and the process 
  18. must be case insensitive. As far as I know, strstr() only locates the 
  19. exact match and is case sensitive.
  20.     Does anyone konw of any functions that could allow me to locate 
  21. substrings and is case insensitive ?
  22.  
  23. Eg.
  24. case 1:
  25.     string1 = "abc"
  26.     string2 = "abcdef" 
  27. case 2:
  28.     string2 = "Abcdef"
  29. case 3:
  30.     string3 = "aBcdef"
  31. case 4:
  32.     string4 = "abCdef"
  33. ...
  34. ..
  35. .
  36.  
  37. Is taking care of all the combinations ( = 8) in string1 the only 
  38. solution ? I'm working on Unix platform.
  39.  
  40. Thankx
  41.  
  42. <hai>
  43.